<?php

class user extends CI_controller {
	
	/**
	 * The currently logged in username
	 */
	public $username;
	
	
	/**
	 * Constructor
	 */
	public function __construct($username) {
		// construct the parent
		parent::__construct();

		$this->username = $username;
	}
	
	
	/**
	 * Function to return the username
	 * 
	 * @return string $username
	 */
	public function get_username() {
		return (string) $this->username;
	}
	
	/**
	 * Function to return the userdata of the given user
	 * 
	 * @return array $userdata
	 */
	public function get_userdata() {
		$this->load->model('user_settings');
		
		if ($userdata = $this->user_settings->get_userdata($this->username))
			return $userdata;
		
		// @TODO return error if return get_userdata === false
	}
	
	
	public function save_user_setings() {
		var_dump('test');
	}
	
}